<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
		<style type="text/css">
			#uploadList ul li{
				list-style: none;
				float: left;
				margin-right: 10px;
				position: relative;
				border: 1px solid #CCC;
			}
			#a_del_li img{
				position: absolute;
				right:-28px;
				top: 6px;
			}
			#uploadTip{
				float:left;
				line-height: 34px;
			}
		</style>
		
		<script type="text/javascript">
			function showUploadify(varName){
				fileVarName = varName;
				$('#file').uploadify({
			        'formData': {
			        		//POST数据
			            '<?php echo session_name();?>' : '<?php echo session_id();?>',
			        },
			        'fileTypeDesc' : '上传文件',
			        'fileTypeExts' : '<?php echo $set['filetype'];?>',
			        'swf'      : 'http://127.0.0.1/vancl/Static/uploadify/uploadify.swf',
			        'uploader' : '<?php echo U("ajaxUpload");?>',
			        'buttonText':'选择文件',
			        'fileSizeLimit' : '2000KB',
			        'uploadLimit' : 1,//上传文件数
			        'multi': false,
			        'width':65,
			        'height':25,
			        'successTimeout':10,//等待服务器响应时间
			        'removeTimeout' : 0.2,//成功显示时间
			        'onUploadSuccess' : function(file, data, response) {
			            data=$.parseJSON(data);
			            var imageUrl = data.image?data.url:'http://127.0.0.1/vancl/Static/image/default.png';
			            var li="<li path='"+data.path+"' url='"+data.url+"'>" +
			            				"<img src='" + imageUrl + "' class='hd-w70 hd-h30'/>" +
			            				"<a id='a_del_li' href='javascript:;' title='删除'>" + 
			            					"<img src='http://127.0.0.1/vancl/Static/Admin/images/close1.png'/>" + 
			            				"</a>" + 
			            				"<input type='hidden' name='" + varName + "' value='" + data.path+"'/>" + 
			            			"</li>";
			            $("#uploadList ul").prepend(li);
			            $("#uploadDiv").html('');
			            $('#uploadTip').hide();
			        }
			    });
			}
			
			$(function() {
			    $('#a_del_li').live('click', function(){
			    		if (!confirm('确定要删除吗？')){
			    			return;
			    		}
			    		$("#uploadList ul li").remove();
			    		var str = "<input id='file' type='file' multiple='true'>";
			
			    		$("#uploadDiv").html(str);
			    		$('#uploadTip').show();
					showUploadify(fileVarName);	
			    });
			});
		</script>